const path = require('path')
const { defineConfig } = require('rollup')
const alias = require('@rollup/plugin-alias')
const dts = require('rollup-plugin-dts').default
const { buildOutputPath } = require('../config')

const outputDir = buildOutputPath

// 路径别名配置
const aliasConfig = require('./alias')

// 打包类型声明文件
module.exports = defineConfig({
  input: path.resolve(__dirname, '../../src/index.ts'),
  output: {
    file: path.resolve(outputDir, 'index.d.ts')
  },
  plugins: [dts(), alias(aliasConfig)]
})
